RetrySync
Definition:
RetrySync()
Description:
Requests the App Server to send its response to the last Synchronise or SyncDataSource call to the Digitise Apps Client.
Platforms:
All
Parameters:
none
Returns:
0
Able to talk to the App Server, but the Server has no previously unsent response available.
1
The previous data transfer request came from a call to Synchronise in sync mode or SyncDataSource. The server will attempt to resend the response, and it will be resent in sync mode.
2
The previous data transfer request came from a call to Synchronise in async mode. The server will attempt to resend the response, and it will be resent in async mode.
Notes:
-
RetrySync can be used in conjunction with the IsRetrySyncAvailable Method to attempt to complete a data upload, initiated using the Synchronise or SyncDataSource Methods, when the App Server is unable to send the result of the data transfer back to the Digitise Apps Client because the connection between the Client and the Server fails. IsRetrySyncAvailable allows you to check whether the App Server was able to return the result of the last data upload and, if not, RetrySync allows you to request it to send the result. For more details refer to the description of the IsRetrySyncAvailable Method (see See also: below).
-
RetrySync will request the response to the last call to Synchronise or SyncDataSource made from the specific Digitise app and Digitise Apps Client combination making the RetrySync request.
-
If the original call to Synchronise or SyncDataSource includes data to be downloaded after the uploaded data has been dealt with, the Server's response will include the download data.
If the original call used SyncDataSource, whether there is any data to download depends on the setting of the Load After Sync Property. However, if Load after Sync is not set to download data, the Server's response will still include the data required to clear the modified flag for records that were successfully uploaded.
-
A successful call to RetrySync will clear the Server's response and a subsequent call to IsRetrySyncAvailable will return False and a call to RetrySync will return 0.
-
You can specify a timeout period (default 1 hour) for the Server to retain its response, along with other options which affect the behaviour of IsRetrySyncAvailable and RetrySync, under the Advanced link in the Server Properties in App Manager. When the specified timeout expires, the App Server will delete its stored response, IsRetrySyncAvailable will then return False and you cannot use RetrySync to obtain the missed response. Calling RetrySync again, without previously calling Synchronise or SyncDataSource, will return an error which will be displayed if Data Error Reporting is enabled, otherwise you can access the error using GetLastError or GetLastDataError.
-
If the App Server is unable to send its response to the Digitise Apps Client for a call to Synchronise in async mode, and you cancel the data transfer using CancelTransaction, IsRetrySyncAvailable will return False and RetrySync will return 0. However, if, in this situation, you stop the transfer by closing the Digitise app or the Digitise Apps Client, after reloading the app, IsRetrySyncAvailable may return True and you may be able to use RetrySync to retrieve the Server's response.
If the response is being resent from the Server to the Client in async mode, you can cancel the transfer using CancelTransaction as usual. Sync mode transfers cannot be cancelled.
-
If the return value is 1, the call to this Method will return to the Script when the synchronise has either completed or it fails. You can call GetLastDataError to check whether the retry succeeded or not.
-
If the return value is 2, the response will be resent in the background and the Script will continue. You can use the OnAsyncCompletion Event to check whether the response was sent successfully or not.
-
If the Digitise Apps Client is unable to contact the App Server and data error reporting is ON, the calling Script will stop and display a Script Error. If data error reporting is OFF, the Script will continue and you can call GetLastError or GetLastDataError to retrieve the error. Data error reporting is turned OFF using the SetDataErrorOn Method or On Error GoTo 0 statement and turned ON using the SetDataErrorOff Method or On Error Resume Next statement. (See See also: below.)
-
RetrySync will only work where both App Server and Client/Standalone App support this feature. The feature was introduced in MX - 2020 Vision Edition and continued in later Digitise Apps versions.
See also: